package 
{
	import net.flashpunk.Entity;
	import net.flashpunk.utils.Draw;
	import net.flashpunk.utils.Data;
	
	/**
	 * ...
	 * @author Felix Fleiß
	 */
	public class NoteLines extends Entity 
	{
		private var screen_width:int;
		private var screen_height:int;
		public function NoteLines() {
			
			screen_width =  Data.readInt("screen_width");
			screen_height = Data.readInt("screen_height");
		}
		override public function render():void 
		{
			super.render();
			drawNoteLines();
		}
		
		private function drawNoteLines():void {
			var note:String = SingingToNote.note;
			var drawHeight:int;
			for (var i:int = 0; i < SingingToNote.noteFreq.length; i++) {
				drawHeight = screen_height - SingingToNote.mapFrequencyToNoteOctaveNorm(SingingToNote.noteFreq[i])*screen_height;
				if(i < 12){
				Draw.line(	1, 	drawHeight,	screen_width, drawHeight,0x555555);
				}
				if (note != null && note == SingingToNote.noteName[i]) {
				Draw.line(	1, 	drawHeight,	screen_width, drawHeight,0x00FF00);
					
				}
			}
		}
	}
	
}